const base_url = 'http://localhost:8082'
export const myRequest = (options) => {
	return new Promise((resolve, reject) => {
		uni.request({
			url: base_url + options.url,
			method: options.method || 'GET',
			data: options.data || {},
			success: res => {
				console.log(res.data.status != 0,'222')
				if (res.data.status != 0) {
					return uni.showToast({
						title: '获取失败'
					})
				}
				resolve(res)
			},
			fail: (err) => {
				uni.showToast({
					title: '请求接口失败'
				})
				reject(err)
			}
		})
	})
}

// myRequest({
// 	url: '/api/getlunbo',
// 	method: 'POST',
// 	data: {}
// })
